import { http } from "@/utils/http";

type ResultTable = {
  total?: number;
  data?: Array<any>;
};

//获取告警信息
export const getALarmData = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/alarm/calculate`, {
    data
  });
};

//获取告警详情
export const getALarmDataDetail = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/alarm/detail`, {
    data
  });
};

//获取Ai预测结果
export const getPredictionDetail = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/evaluate/prediction/query`, {
    data
  });
};

//数据展示详情接口
export const getDataSummary = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/refrigeration/data/summary`, {
    data
  });
};

//查询chart图标数据
export const getChartData = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/refrigeration/load/query`, {
    data
  });
};

//查询 热力图 数据
export const getChartOfHeatMapData = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/refrigeration/heatmap/query`, {
    data
  });
};

//表格数据标记
export const remarkTableItem = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/alarm/remark`, {
    data
  });
};

//查询策略包数据
export const queryStrategyData = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/refrigeration/strategy/query`, {
    data
  });
};
//查询策略包数据V2
export const queryStrategyDataV2 = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/refrigeration/strategy/queryV2`, {
    data
  });
};

//操作策略包数据
export const operateStrategyData = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/refrigeration/strategy/operate`, {
    data
  });
};

//反馈策略包数据
export const feedbackStrategyData = (data?: object) => {
  return http.request<ResultTable>("post", `/operation/api/v1/refrigeration/strategy/feedback`, {
    data
  });
};

// PCW 洁净室热力图接口
export const correlationFactorMachineCoolApi = (data?: object) => {
  return http.request("post", `/operation/api/v1/operation/algorithm/correlationFactorMachineCool`, {
    data
  });
};

// 生成计算任务高效机房
export const correlationFactorMachineApi = (data?: object) => {
  return http.request("post", `/operation/api/v1/operation/algorithm/correlationFactorMachine`, {
    data
  });
};

// 依据uuid计算生成的结果
export const cacheRedisApi = (data?: object) => {
  return http.request("post", `/operation/api/v1/operation/algorithm/cacheRedis`, {
    data
  });
};

// 负荷预测、COP分析图、冰机COP
export const queryPredicated = (data: object | undefined) => {
  return http.request("post", `/operation/api/v1/refrigeration/load/queryPredicated`, { data }, { headers: { noLoading: false } });
};

// MAU冷量负荷
export const queryMauFutureAPI = (data: object | undefined) => {
  return http.request("post", `/operation/api/v1/operation/algorithm/queryMauFuture`, { data });
};
// DCC负荷预测-old
// export const queryDCCFutureAPI = (data: object | undefined) => {
//   return http.request("post", `/operation/api/v1/operation/algorithm/queryDCCFuture`, { data });
// };
// DCC负荷预测
export const queryDCCFutureAPI = (data: object | undefined) => {
  return http.request("post", `/operation/api/v1/water/algorithmMachine/queryLineDCC`, { data });
};

// MAU负荷预测-old
// export const queryMAUALLFutureAPI = (data: object | undefined) => {
//   return http.request("post", `/operation/api/v1/operation/algorithm/queryMAUALLFuture`, { data });
// };

// MAU负荷预测
export const queryMAUALLFutureAPI = (data: object | undefined) => {
  return http.request("post", `/operation/api/v1/water/algorithmMachine/queryLineMau`, { data });
};
// 运行优化建议 4个tab接口
export const queryLineLoadAPI = (data: object | undefined) => {
  return http.request("post", `/operation/api/v1/water/algorithmMachine/queryLineLoad`, { data });
};
